package com.lagou.controller;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.thymeleaf.util.StringUtils;

import java.io.UnsupportedEncodingException;
import java.util.concurrent.ExecutionException;

@Controller
public class PayController {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @GetMapping("/pay/{orderId}")
    public String confirm(@PathVariable("orderId") String orderId, Model model) throws UnsupportedEncodingException {
        //省略插入数据库操作

        model.addAttribute("orderId", orderId);

        return "success";
    }
}
